<?php

/**
 * Class SysRoleModuleGroupLogic
 */
class SysRoleModuleGroupLogic extends Model
{
    private $_modelSysRoleModuleGroup = null;
    private $_customerId = null;

    public function __construct()
    {
        $this->_customerId = Session::$user['customerId'];
        Session::switchCustomer(0);

        $this->_modelSysRoleModuleGroup = D('SysRoleModuleGroup');

        Session::switchCustomer($this->_customerId);
    }


    /** --------------------------------------  增  -------------------------------------- */

    /** --------------------------------------  删  -------------------------------------- */


    /** --------------------------------------  改  -------------------------------------- */

    /** --------------------------------------  查  -------------------------------------- */

    /**
     * 更加模块id查看改模块id对应的系统角色id列表
     *
     * @param $moduleId
     * @return mixed
     */
    public function getRoleIdsByGroupId($moduleId)
    {
        return $this->_modelSysRoleModuleGroup->where(['moduleId' => $moduleId])->getField('sysRoleId', TRUE);
    }
}